WORKFLOW_DIR=$(dirname "$(realpath "$0")")
cd "$WORKFLOW_DIR"/../../scripts
pwd

SCRIPT_DIR=$(dirname "$(realpath "$0")")
PROJECT_DIR=$(realpath "$SCRIPT_DIR"/../)
export CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7

mkdir -p ${PROJECT_DIR}/outputs

sh run.sh \
    --train_stage "VLM_PT" \
    --model_size 1B-dense \
    --learning_rate 4e-4 \
    --num_warmup_steps 200 \
    --num_train_epochs 1 \
    --max_seq_len 640 \
    --data_path "${PROJECT_DIR}/resource/dataset/minimind2-v/pretrain_vlm_data_1.jsonl" \
    --images_path "${PROJECT_DIR}/resource/dataset/minimind2-v/pretrain_images" \
    --images_lmdb_path None \
    --load_ckpt_path "${PROJECT_DIR}/outputs/SFT_release/SFT.pth" \
    --save_dir ${PROJECT_DIR}/outputs/VLM_PT_lr4e-4_epoch1 \
    --train_micro_batch_size_per_gpu 16 \
    --gradient_accumulation_steps 1 \
    --zero_stage 1 \

wait
echo "start sh run_vlm_sft.sh----------------------------"
sh run.sh \
    --train_stage "VLM_SFT"  \
    --model_size 1B-dense  \
    --learning_rate 5e-6 \
    --num_warmup_steps 50 \
    --num_train_epochs 1 \
    --max_seq_len 1536 \
    --data_path ${PROJECT_DIR}/resource/dataset/minimind2-v/sft_vlm_data_1.jsonl \
    --images_path ${PROJECT_DIR}/resource/dataset/minimind2-v/sft_images \
    --images_lmdb_path None \
    --load_ckpt_path ${PROJECT_DIR}/outputs/VLM_PT_lr4e-4_epoch1/VLM_PT.pth \
    --save_dir ${PROJECT_DIR}/outputs/VLM_SFT_lr5e-6_epoch1 \
    --train_micro_batch_size_per_gpu 4 \
    --gradient_accumulation_steps 8 \
    --zero_stage 1 \
